package tools

import (
	"encoding/json"
	"net/http"
)

// OutPutSuccess 正常信息返回
func OutPutSuccess(w http.ResponseWriter, data interface{}) {
	_ = json.NewEncoder(w).Encode(map[string]interface{}{
		"code": 200,
		"data": data,
	})
}

// OutPutError 异常错误返回
func OutPutError(w http.ResponseWriter, err string) {
	_ = json.NewEncoder(w).Encode(map[string]interface{}{
		"code": 500,
		"data": err,
	})
}
